package com.example.gaojt.androiddemo.boostDemo;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;

import com.example.gaojt.androiddemo.boostDemo.aa.BoostResult;
import com.example.gaojt.androiddemo.boostDemo.aa.BoostScanEngine;
import com.example.gaojt.androiddemo.boostDemo.aa.ProcessModel;

/**
 * Created by gaojt on 7/26/17.
 */

public class BoostDemoActivity extends Activity {
    private static final String TAG = "BoostDemoActivity";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // new BoostApi().aa(this);
        // List<ActivityManager.RunningAppProcessInfo> list = ProcessManager.getRunningAppProcessInfo(this);
        // if (list == null) {
        // return;
        // }
        // Log.d(TAG, "onCreate: size = " + list.size());
        // for(ActivityManager.RunningAppProcessInfo info:list) {
        // Log.d(TAG, "onCreate: " + info.processName);
        // }
        BoostScanEngine scanEngine = new BoostScanEngine();
        scanEngine.setBoostScanCallback(new BoostScanEngine.BoostScanCallback() {
            @Override
            public void onScanStart() {
                Log.d(TAG, "onScanStart: ");
            }

            @Override
            public void onScanError() {
                Log.d(TAG, "onScanError: ");
            }

            @Override
            public void onScanProgress(ProcessModel data) {
                Log.d(TAG, "onScanProgress: data = " + data);
            }

            @Override
            public void onScanPreFinish(BoostResult results) {
                Log.d(TAG, "onScanPreFinish: results = " + results);
            }

            @Override
            public void onScanFinish(BoostResult results) {
                Log.d(TAG, "onScanFinish: results = " + results);
            }
        });
        scanEngine.scan(this);
    }
}
